<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$user_id = get_loggedin_userid();

$purchases = array();

$references = dt_get_purchases($user_id);
foreach ($references as $reference) {
    $purchases[] = $reference->reference;
}

$reputation = dt_calc_reputation($user_id);

$result = array(
    'coins' => dt_export_coins($user_id),
    'purchases' => $purchases,
    'reputation' => $reputation
);

echo json_encode(export_result(200, $result));

?>
